Commands and Conditional Substitutions

There are some commands and codes which are able to be used in a variety of places in message templates which perform special tasks. Commands and Conditionals are removed on output, so they are not visible in the generated messages.

Commands

Commands are codes which tell the messaging engine how to handle certain aspects of the message output e.g., emailing and printing.

Commands are always placed at the top of the template document outside of the header area. The commands always have a START and END and they are in single chevron brackets < >.

In the table following are the Commands and examples of their usage.

Email Commands

Command Description & Comment
The EMAIL_CMD commands define the email addressing format - From, To, Subject etc. Other email codes are supported - e.g., CC, BCC, Reply To etc.
<EMAIL_CMD_START> Indicates beginning of email send command
To: <aep> The email "To" line - e.g., <aep> = the Agent email address from the agent contact list
From: <ue> The email "From" line - e.g., <ue> = the Tourplan users email address
Reply To: <sep> The email "Reply To" line - e.g., <sep:rs> = the Suppliers email address from the supplier contact list. (For this example the RS contact code will generate the "Reservations" email address.
Subject: This can be a combination of text and substitution codes - e.g., "Booking Confirmation for <bn> Travelling on <td>
<EMAIL_CMD_END> Indicates end of the email send command.

The EMAIL_CONTAINER commands mark the beginning and end of email text that is the email carrying the message as an attachment. The attachment type needs to be declared somewhere in the command area e.g.,

EMAIL_FORMAT:PDF will convert the message output from Tourplan NX to pdf format and attach it to the email defined between the EMAIL_CONTAINER tags.

<EMAIL_CONTAINER_START> Indicates the beginning of the Container email message.
Dear <ct> e.g., Address the email to the Booking Agent Contact Name.

The booking confirmation for <bn> travelling on <td> is attached. The confirmation shows the current status of the booking services.

Please contact me if you have any queries,

Best regards,

<ufn>

<EMAIL_CONTAINER_END> Indicates the end of the Container email message.

Everything below the <EMAIL_CONTAINER_END> command will be converted into the email attachment.

NOTE: Email subject lines can use substitution codes, for example you may want the subject line to display the booking reference, you can use the substitution code to insert the booking reference.

Print Command

Print commands do not have to be embedded in the message template if the message output is to be printed. A list of available printers will display for the user to choose from. If a specific printer is required for a specific document type - e.g., Cheques - then the Print Command can be used. The Print Commands are also placed at the top of the template document outside of the header area.

More than 1 print command can be between the start and end. In this example, there is Printer1, but there could also be Printer2 and Printer3.

Command Description & Comment
<PRINT_CMD_START> Indicates the beginning of the print command
Printer1: HP Color Laserjet 3600 The print queue name that the messaging webservices will use to direct the output to.
PrinterName1: Accounts The printer display name that the user will see
<PRINT_CMD_END> Indicates the end of the print command

 

 

Conditional Substitutions

Conditional Substitutions allow codes to be used that will only be substituted if the criteria of the code are met. The most common of these are a) to remove blank lines if the field being substituted has no data in it - e.g., a Remarks field or Pickup/Dropoff fields etc and b) suppressing numeric values if 0 is returned.

These two conditions refer to the codes <RMS:??> and <RME:??>

Purpose Description & Comment
Zero Flagging All numeric substitution codes can have a :0 parameter specified. This means that when their value is zero, the code will be substituted as a blank. for example <SG:0> will output blank if the value for SG (Single Room) is 0 This is the same as using <RMS:BL><SG><RME:BL>
Row Deletion

When defining message templates within tables in Word, there is a command to remove the entire table row - <RMS:ROW>. This does not need a corresponding <RME>, since the table row that <RMS:ROW> is in will be removed entirely.

As an example, the booking only had text in Voucher Text 3, the following template definition:

Booking Name <BN>
<RMS:ROW>Voucher Text 1 <VT1>
<RMS:ROW>Voucher Text 2 <VT2>
<RMS:ROW>Voucher Text 3 <VT3>
<RMS:ROW>Voucher Text 4 <VT4>
<RMS:ROW>Voucher Text 5 <VT5>
would be output as:
Booking NameHarness Racing Victoria N.Z. 2019
Voucher Text 3Voucher Text 3 field data
Value Deletion

The existing <RMS:BL> and <RME:BL> tags are still available and will delete zero value content that is between those tags. They will only delete the data content not the structure of the document and so will not remove rows if they are used within a table

Zero Flagging

Zero flagging can be used in conjunction with either Row or Value deletion so that sections of the document can be removed based on only some of the substitution codes being 0 value.

One example is Service Extras where a message section could be defined as:
<RMS:ROW><EX1><AGENT:EX1:0><CUR>
<RMS:ROW><EX2><AGENT:EX2:0><CUR>
<RMS:ROW><EX3><AGENT:EX3:0><CUR>
<RMS:ROW><EX4><AGENT:EX4:0><CUR>
<RMS:ROW><EX5><AGENT:EX5:0><CUR>

If Extra 2 was the only extra being used, the output would appear as:

Cooked Breakfast31.00NZD

The same technique can also be used inside table contents and for non-numeric data where the entire row is not to be deleted. For example:

Booking Name<BN>Travelling<TD>
<RMS:BL> Agent Reference<AR> <RME:BL>Agent<AC>
<RMS:BL> Special Requirements

<UDTEXT2>

<UDTEXT3> <RME:BL>

Consultant<CN>
<RMS:ROW> Additional Information

<NTS:TP>

<NTS:TG>

 

If the booking used the Agent Reference field and the 4 UDText fields then the message generated would be:

Booking NameSnelling Party x 4Travelling05/10/2019
Agent ReferenceAG1019089AgentABC001
Special Requirements

Prefers rooms below level 4

Fast WiFi for teenagers

ConsultantGRB
Additional Information

Tour Code TG1909

Tour Prefix XYZ

 

If none of the Agent Reference field, 2 UDText and 2 Notes fields had data in them it would look like:

Booking NameSnelling Party x 4Travelling05/10/2019
  AgentABC001
  

Consultant

 

GRB